#include "IWorkThread.h"

IWorkThread::IWorkThread(IBackgroundWorker * controller) : wxThread()
{
	m_controller = controller;
}
void * IWorkThread::Entry()
{
    wxThread::ExitCode iError = EXIT_SUCCESS;
    while(!TestDestroy())
    {
		iError = (wxThread::ExitCode)(m_controller->Engine());
		if(iError != EXIT_SUCCESS) break;
    }
	m_controller->Result();
	m_controller->SetProgress(false);
    if(iError == EXIT_SUCCESS) return iError;
    return iError;
}
